import request from '@/utils/request'

// 渠道列表-分页版本
export function queryPageChannelDataList(data) {
  return request({
    url: `/channel/list?page=${data.pageNum}`,
    method: 'post',
    data: data
  })
}

// 添加渠道
export function addChannelData(data) {
  return request({
    url: '/channel/add',
    method: 'post',
    data: data
  })
}

// 修改渠道
export function editChannelData(data) {
  return request({
    url: '/channel/edit',
    method: 'post',
    data: data
  })
}

// 修改渠道状态
export function updateChannelStatus(data) {
  return request({
    url: '/channel/update/status',
    method: 'post',
    data: data
  })
}

// 查渠道详情
export function queryChannelDataDetail(data) {
  return request({
    url: '/channel/detail',
    method: 'post',
    data: data
  })
}

// 修改广告主ID
export function updateChannelAdId(data) {
  return request({
    url: '/channel/update/ad_id',
    method: 'post',
    data: data
  })
}

// 获取抖音小程序短链
export function getDyUrlLink(data) {
  return request({
    url: '/channel/get/dy_url_link',
    method: 'post',
    data: data
  })
}

// 投放平台
export const DELIVERY_PLATFORM = {
  1: '抖音',
  2: 'APP',
  999: '其它'
}

// 状态
export const STATUS = {
  1: '投放中',
  2: '停投'
}
